-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFC parseComponent pads complete content with spaces #5059
SFC parseComponent pads complete content with spaces #5059
Conversation
when `{ pad: true }` is provided. That is, all content is converted to spaces. Previously, each line was truncated to "//". The new padding method works better with character-oriented tools that calculate positions by distance from the beginning of the file instead of by line number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This is an interesting change - one of the implications (and the reason why I used comments before) is when used with a linter that checks whitespaces or blank lines, this would raise a lot of warnings... (e.g. Maybe we can change the option to use different values, e.g. |
Good idea. I didn't think about the linter case. I'll change the type of pad to |
Also still supports true for backward compatibility. True is the same as "line".
The pad option now accepts 'line' or 'space' as padding options. Depends on vuejs/vue#5059
The pad option now accepts 'line' or 'space' as padding options. Depends on vuejs/vue#5059
The pad option now accepts 'line' or 'space' as padding options. Depends on vuejs/vue#5059
SFC
parseComponent
pads all content with spaces when{ pad: true }
is provided. That is, all content is converted to spaces. Previously, each line was truncated to//
. The new padding method works better with character-oriented tools that calculate positions by distance from the beginning of the file instead of by linenumber.
Fixes #5058.